<!DOCTYPE html>
<html lang="zh-tw">
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Scala 是一個可直譯、可編譯、靜態、可運行於 JVM 之上、可與 Java 互操作、融合物件導向編程特性與函式編程風格的程式語言。">
    <meta property="og:locale" content="zh_TW">
    <meta property="og:title" content="Scala Gossip">
    <meta property="og:type" content="article">
    <meta property="og:url" content="http://openhome.cc/Gossip/Scala/index.html">
    <meta property="og:image" content="http://openhome.cc/Gossip/images/caterpillar_small.jpg">
    <meta property="og:site_name" content="OPENHOME.CC">
    <meta property="og:description" content="Scala 是一個可直譯、可編譯、靜態、可運行於 JVM 之上、可與 Java 互操作、融合物件導向編程特性與函式編程風格的程式語言。">
    <title>語言技術：Scala Gossip</title>
    <link rel="stylesheet" href="../css/pure-0.6.0/pure-min.css">
    <!--[if lte IE 8]>
        <link rel="stylesheet" href="../css/layouts/side-menu-old-ie.css">    <![endif]-->
    <!--[if gt IE 8]><!-->
    <link rel="stylesheet" href="../css/layouts/side-menu.css">
    <!--<![endif]-->
    <link rel="stylesheet" href="../css/caterpillar.css">
    <script async src="../google-code-prettify/run_prettify.js"></script>
  </head>
  <body>
        <div id="layout">
      <!-- Menu toggle --> <a href="#menu" id="menuLink" class="menu-link">
        <!-- Hamburger icon --><span></span>  </a>
      <div id="menu">
        <div class="pure-menu"> <a class="pure-menu-heading" href="../index.html">回 OPENHOME 首頁</a>
          <ul class="pure-menu-list">
            <br><div class="social" style="text-align: center;"><a href="http://twitter.com/caterpillar"><img title="Twitter" alt="Twitter" src="http://openhome.cc/Gossip/images/twitter.png"></a> <a href="http://www.facebook.com/openhome.cc"><img title="Facebook" alt="Facebook" src="http://openhome.cc/Gossip/images/facebook.png"></a> <a href="https://plus.google.com/+JustinSDK/"><img title="Google+" alt="Google+" src="http://openhome.cc/Gossip/images/google.png"></a></div><br>
              <div id="search box"><script>(function() {var cx = 'partner-pub-9750319131714390:3926766884';var gcse = document.createElement('script');gcse.type = 'text/javascript';gcse.async = true;gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(gcse, s);})();</script><gcse:searchbox-only></gcse:searchbox-only></div><br><div class="ad" style="text-align: center;">
                <script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                <!-- 2015 新版型 160 x 600 廣告 --> <ins class="adsbygoogle"

                  style="display:inline-block;width:160px;height:600px"

                  data-ad-client="ca-pub-9750319131714390" data-ad-slot="3747048883"></ins>
                <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div></li>
          </ul>
        </div>
      </div>
      <div id="main">
        <div class="header">
          <h1>語言技術：Scala Gossip</h1>
        </div>
        <div class="content">
          <p> </p>
          <span style="font-style: italic;">If I were to pick a language to use today other than Java, it would be
            <span style="font-weight: bold;">Scala</span>.</span><span style="font-style: italic;"> <br>
            - James
            Gosling, creator of Java -<br>
            <br>
            I can honestly say if someone had shown me the </span><a style="font-style: italic;"
            href="http://www.amazon.com/Programming-Scala-Comprehensive-Step-step/dp/0981531601/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1240563267&amp;sr=8-1">Programming in Scala</a><span
            style="font-style: italic;"> book by by Martin Odersky, Lex Spoon &amp; Bill Venners back in 2003 I'd probably have never created Groovy.</span><br>
          - James Strachan, creator of Groovy -<br>
          <br>
          Scala 是一個可直譯、可編譯、靜態、可運行於 JVM 之上、可與 Java&nbsp;互操作、融合物件導向編程特性與函式編程風格的程式語言。<br>
          <br>
          文件基於 Scala 2.7.7 撰寫<br>
          <br>
          
                    <div class="ad-2" style="text-align: center;">
          
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 2015 新版型回應式廣告 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-9750319131714390"
     data-ad-slot="7104125683"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
          
          </div>
          <dl>
            <dt>起步走</dt>
          </dl>
          &nbsp; &nbsp; &nbsp; &nbsp; 從一些簡單的語法開始，了解 Scala 的許多特性，所以就算是起步走，東西也夠多了。
          <ul>
            <li>基本環境與指令</li>
          </ul>
          <div style="margin-left: 40px;">簡單的小程式可以使用 scala 指令，編譯的事就交給 scalac，編譯想快點就用 fsc。</div>
          <ul>
            <ul>
              <li><a href="InteractiveShell.html">指令互動環境</a></li>
              <li><a href="ScalaCommand.html">scala
                  指令</a></li>
              <li><a href="ScalacFscCommand.html">scalac
                  與 fsc</a></li>
            </ul>
          </ul>
          <ul>
            <li>資料、變數、操作</li>
          </ul>
          <div style="margin-left: 40px;">所有的東西都是物件，所有的操作都是方法。</div>
          <ul>
            <ul>
              <li><a href="Type.html">資料型態</a></li>
              <li><a href="VariableConstant.html">變數、常數</a></li>
              <li><a href="OperatorMethod.html">操作方法</a></li>
              <li><a href="OperatorExample.html">數值操作</a></li>
              <li><a href="OperatorPrecedenceAssociativity.html">操作順序與關聯</a><br>
              </li>
              <li><a href="ConsoleIO.html">主控台輸入輸出</a></li>
            </ul>
          </ul>
          <ul>
            <ul>
            </ul>
            <li>內建控制結構</li>
          </ul>
          <div style="margin-left: 40px;">運算式有傳回值，迴圈沒有，對了！Scala 沒有 break 與 continue。</div>
          <ul>
            <ul>
              <li><a href="IfExpression.html">if
                  運算式</a></li>
              <li><a href="ForExpression.html">for
                  運算式</a></li>
              <li><a href="WhileLoop.html">while
                  迴圈</a></li>
              <li><a href="MatchExpression.html">match
                  運算式</a></li>
              <li><a href="TryExpression.html">try
                  運算式</a></li>
            </ul>
          </ul>
          <ul>
            <ul>
            </ul>
            <li>函式、類別</li>
          </ul>
          <div style="margin-left: 40px;">先從一些簡單的自定義開始，更多的花樣在後頭。</div>
          <ul>
            <ul>
              <li><a href="Function.html">簡單的函式</a></li>
              <li><a href="Class.html">簡單的類別</a></li>
              <li><a href="SingletonObject.html">單例物件</a></li>
            </ul>
          </ul>
          <ul>
            <ul>
            </ul>
            <li>常用物件</li>
          </ul>
          <div style="margin-left: 40px;">在變與不變之間，先體會 Scala 更多的特性。</div>
          <ul>
            <ul>
              <li><a href="String.html">String</a></li>
              <li><a href="Array.html">Array</a></li>
              <li><a href="ListTuple.html">List
                  與 Tuple</a></li>
              <li><a href="SetMap.html">Set
                  與 Map</a></li>
            </ul>
          </ul>
          <br>
          <br>
          <dl>
            <dt>了解更多</dt>
          </dl>
          <ul>
          </ul>
          &nbsp; &nbsp; &nbsp; &nbsp; Scala 本身具有擴充性，不過這必須了解更多語法特性與細節。
          <ul>
            <li>定義函式</li>
          </ul>
          <div style="margin-left: 40px;">函式語法看似繁多，但基本上從函式為一級（First-class）公民的出發點開始，就不會覺得複雜了。</div>
          <ul>
            <ul>
              <li><a href="OverloadLocalRepeat.html">函式重載、區域函式、重複參數</a></li>
              <li><a href="FirstClassFunction.html">一級函式（First-class function）</a></li>
              <li><a href="Closure.html">閉包（Closure）</a></li>
              <li><a href="PartiallyAppliedFunction.html">部份套用函式（Partially applied function）</a></li>
              <li><a href="ByNameParameter.html">以名呼叫參數（By-name parameter）</a></li>
              <li><a href="Curry.html">鞣製（Curry）</a></li>
            </ul>
          </ul>
          <ul>
            <li>定義類別</li>
          </ul>
          <div style="margin-left: 40px;">Scala 建構式有些限制，使用方法可以定義所謂運算子（Operator），提供語法蜜糖與存取方法。</div>
          <ul>
            <ul>
              <li><a href="Constructor.html">建構式</a></li>
              <li><a href="Method.html">定義操作方法</a></li>
              <li><a href="ApplyUpdate.html">apply() 與 update() 方法</a></li>
              <li><a href="AccessorModifier.html">屬性存取方法</a></li>
            </ul>
          </ul>
          <ul>
            <li>使用繼承</li>
          </ul>
          <div style="margin-left: 40px;">Scala 的繼承作了一些限制，這使你在使用繼承前必須多一份思考。</div>
          <ul>
            <ul>
              <li><a href="Inheritance.html">繼承</a></li>
              <li><a href="ShadowOverride.html">遮蔽（Shadow）與重新定義（Override）</a></li>
              <li><a href="ParameterLessMethod.html">無參數方法</a></li>
              <li><a href="AbstractClass.html">抽象類別</a></li>
              <li><a href="ObjectEquality.html">物件相等性</a></li>
              <li><a href="OverrideEquals.html">重新定義 equals() 方法</a></li>
            </ul>
          </ul>
          <ul>
            <ul>
            </ul>
            <li>混入特徵（Trait）</li>
          </ul>
          <div style="margin-left: 40px;">特徵抽離共同的介面與實作，類別動態地繼承（extends）或具有（with）特徵。</div>
          <ul>
            <ul>
              <li><a href="TraitAsInterface.html">作為規範介面的特徵</a></li>
              <li><a href="TraitAsCommImpl.html">作為共用實作的特徵</a></li>
              <li><a href="StackableModification.html">堆疊修飾（Stackable modification）</a></li>
            </ul>
          </ul>
          <ul>
            <li>類別管理</li>
          </ul>
          <div style="margin-left: 40px;">東西別亂擺，方便別亂給，權限別亂設。</div>
          <ul>
            <ul>
              <li><a href="Package.html">套件（Package）</a></li>
              <li><a href="Import.html">匯入（Import）</a></li>
              <li><a href="AccessModifier.html">存取修飾</a></li>
              <li><a href="ClassHierarchy.html">類別階層</a></li>
            </ul>
          </ul>
          <div class="ad-3" style="text-align: center;">
            <script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            <!-- 2015 新版型回應式廣告 --> <ins class="adsbygoogle" style="display:block"

              data-ad-client="ca-pub-9750319131714390" data-ad-slot="7104125683"

              data-ad-format="auto"></ins>
            <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script> </div>
          <dl>
            <dt>繼續深入</dt>
          </dl>
          <ul>
            <li>模式比對（Pattern match）</li>
          </ul>
          <div style="margin-left: 40px;">還在寫 if..else 嗎？有些情況使用模式比對可以作的更好、更簡潔！</div>
          <ul>
            <ul>
              <li><a href="CaseClass.html">案例類別（Case class）</a></li>
              <li><a href="BasicPattern.html">基本模式</a></li>
              <li><a href="ListTuplePattern.html">List 與 Tuple 模式</a></li>
              <li><a href="VariableBindingPatternGuard.html">變數綁定（Variable binding）、模式防護（Pattern guard）</a></li>
              <li><a href="Option.html">Option 型態</a></li>
              <li><a href="SealedClass.html">密封類別（Sealed class）</a></li>
              <li><a href="PartialFunction.html">部份函式（Partial function）</a></li>
            </ul>
          </ul>
          <ul>
            <li>提取器（Extractor）</li>
          </ul>
          <div style="margin-left: 40px;">更有彈性地運用模式比對的一種方式。</div>
          <ul>
            <ul>
              <li><a href="ApplyUnApply.html">apply() 與 unapply() 方法</a></li>
              <li><a href="UnapplySeq.html">不同個數的元素提取</a></li>
              <li><a href="RegularExpressionExtractor.html">規則表示式與提取器</a></li>
            </ul>
          </ul>
          <ul>
            <li>進階型態</li>
          </ul>
          <div style="margin-left: 40px;">類別、特徵之外，還有更多的型態。。XD</div>
          <ul>
            <ul>
              <li><a href="AbstractMember.html">抽象成員</a></li>
              <li><a href="InitializeVal.html">初始抽象 val&nbsp;成員</a></li>
              <li><a href="TypeMember.html">型態（type）成員</a></li>
              <li><a href="PathDependentType.html">路徑相依型態（Path-dependent type）</a></li>
              <li><a href="Enumeration.html">列舉（Enumeration）</a></li>
              <li><a href="StructuralTyping.html">結構型態（Structural typing）</a></li>
            </ul>
          </ul>
          <ul>
            <li>型態參數化（Type parameterization）</li>
          </ul>
          <div style="margin-left: 40px;">定義可參數化型態，讓 Scala 型態系統更有彈性。</div>
          <ul>
            <ul>
              <li><a href="TypeParameterization.html">型態參數基礎</a></li>
              <li><a href="UpperboundLowerboundViewbound.html">上界（Upper bound）、</a><a
                  href="UpperboundLowerboundViewbound.html">下界（Lower bound）、視界（View bound）</a></li>
              <li><a href="Covariance.html">共變性（Covariance）</a></li>
              <li><a href="Contravariance.html">逆變性（Contravariance）</a></li>
              <li><a href="ExistentialType.html">既存型態（Existential type）</a></li>
              <li><a href="TypeParameterizationEquality.html">參數化型態的物件相等性</a></li>
            </ul>
          </ul>
          <ul>
            <li>隱式轉換（Implicit conversion）</li>
          </ul>
          <div style="margin-left: 40px;">一切都是編譯器搞的鬼。。。XD</div>
          <ul>
            <ul>
              <li><a href="RulesForImplicits.html">轉換規則</a></li>
              <li><a href="ImplicitFunction.html">隱式函式</a></li>
              <li><a href="ImplicitParameter.html">隱式參數</a></li>
            </ul>
          </ul>
          <ul>
            <li>Scala 與 Java</li>
          </ul>
          <div style="margin-left: 40px;">站在巨人的肩膀上。。。XD</div>
          <ul>
            <ul>
              <li><a href="Annotation.html">標註（Annotation）</a></li>
              <li><a href="UsingJavaInScala.html">在 Scala 中使用 Java 類別</a></li>
              <li><a href="UsingScalaInJava.html">在 Java 中使用 Scala 類別</a></li>
              <li><a href="AdvancedScalaJava.html">進階型態對應探討</a></li>
            </ul>
          </ul>
          <br>
          <br>
          <br>
          <dl>
            <dt>參考資料</dt>
          </dl>
          <ul>
            <li><a href="http://www.artima.com/scalazine/articles/steps.html">First
                Steps to Scala</a></li>
            <li><a href="http://www.amazon.com/Programming-Scala-Comprehensive-Step-step/dp/0981531601/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1240563267&amp;sr=8-1">Programming in Scala</a></li>
          </ul>
<div class="recommend" style="text-align: center;">
          <hr>
          <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 自動大小回應相符內容 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-9750319131714390"
     data-ad-slot="4953478487"
     data-ad-format="autorelaxed"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div> 
        </div>
      </div>
    </div>
    <script src="../js/ui.js"></script>
    <div class="analytics">
      <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-143766-1', 'auto');
  ga('send', 'pageview');

</script></div>
  </body>
</html>
